﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FM.接口;
using Microsoft.Practices.Prism.PubSubEvents;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;

namespace FM.播音.服务器
{
    public class 系统初始化 : I启动
    {

        private IRegionManager 行政部;
        private IEventAggregator 宣传部;
        private IUnityContainer 人事部;
        public 系统初始化(IUnityContainer 人事部cs, IEventAggregator 宣传部cs, IRegionManager 模块cs)
        {
            人事部 = 人事部cs;
            宣传部 = 宣传部cs;
            行政部 = 模块cs;
        }

        public void 启动()
        {
            Is启动 = true;


            行政部.RegisterViewWithRegion(布局位置.下, () =>
            {
                var 视图2 = 人事部.Resolve<Views.状态栏>();
                视图2.LoadViewModel();
                return 视图2;
            });

            行政部.RegisterViewWithRegion(布局位置.上, () =>
            {
                var 视图2 = 人事部.Resolve<Views.菜单>();
                视图2.LoadViewModel();
                return 视图2;
            });

        }


        public bool Is启动 { get; private set; }
    }
}
